CREATE TRIGGER TRG_ACCT_IDSEQ
    BEFORE INSERT
    ON T_ACCOUNT

    FOR EACH ROW
    BEGIN
        SELECT S_ACCOUNT.NEXTVAL INTO :new.ACCOUNT_ID
            FROM DUAL;
    END;
/

CREATE TRIGGER TRG_AUTH_IDSEQ
    BEFORE INSERT
    ON T_AUTHORITY

    FOR EACH ROW
    BEGIN
        SELECT S_AUTHORITY.NEXTVAL INTO :new.AUTHORITY_ID
            FROM DUAL;
    END;
/

CREATE TRIGGER TRG_USER_IDSEQ
    BEFORE INSERT
    ON T_USER

    FOR EACH ROW
    BEGIN
        SELECT S_USER.NEXTVAL INTO :new.USER_ID
            FROM DUAL;
    END;
/

CREATE TRIGGER TRG_ADPEACCT_IDSEQ
    BEFORE INSERT
    ON T_ADPEACCOUNT
    FOR EACH ROW
    BEGIN
        SELECT S_ADPEACCOUNT.NEXTVAL INTO :new.ACCOUNTID
            FROM DUAL;
    END;
/

CREATE TRIGGER TRG_DRA_IDSEQ
    BEFORE INSERT
    ON T_DRA
    FOR EACH ROW
    BEGIN
        SELECT S_DRA.NEXTVAL INTO :new.DRAID
            FROM DUAL;
    END;
/

CREATE TRIGGER TRG_EQUIPITEM_IDSEQ
    BEFORE INSERT
    ON T_EQUIPMENTITEM
    FOR EACH ROW
    BEGIN
        SELECT S_EQUIPMENTITEM.NEXTVAL INTO :new.ITEMID
            FROM DUAL;
    END;
/

CREATE TRIGGER TRG_ITEMSTATUS_IDSEQ
    BEFORE INSERT
    ON T_ITEMSTATUS
    FOR EACH ROW
    BEGIN
        SELECT S_ITEMSTATUS.NEXTVAL INTO :new.STATUSID
            FROM DUAL;
    END;
/

CREATE TRIGGER TRG_ACCTCUST_IDSEQ
    BEFORE INSERT
    ON T_ADPEACCT_CUSTODIAN_LINK
    FOR EACH ROW
    BEGIN
        SELECT S_ACCTCUSTID.NEXTVAL INTO :new.ID
            FROM DUAL;
    END;
/

CREATE TRIGGER TRG_ORGANIZATION_IDSEQ
    BEFORE INSERT
    ON T_ORGANIZATION
    FOR EACH ROW
    BEGIN
        SELECT S_ORGANIZATION.NEXTVAL INTO :new.ORGANIZATIONID
            FROM DUAL;
    END;
/

CREATE TRIGGER TRG_EQUIPMENTTYPE_IDSEQ
    BEFORE INSERT
    ON T_EQUIPMENTTYPE
    FOR EACH ROW
    BEGIN
        SELECT S_EQUIPMENTTYPE.NEXTVAL INTO :new.TYPEID
            FROM DUAL;
    END;
/

create or replace trigger TRG_EQUIPMENTTYPE_AUDIT
    BEFORE INSERT or UPDATE
    on T_EQUIPMENTTYPE
    FOR EACH ROW
    BEGIN
      :NEW.updatedby := USER;
      :NEW.lastDateUpdated := SYSDATE;
    END;
/

CREATE TRIGGER TRG_ITEMCONDITION_IDSEQ
    BEFORE INSERT
    ON T_EQUIPMENTTYPE
    FOR EACH ROW
    BEGIN
        SELECT S_ITEMCONDITION.NEXTVAL INTO :new.ITEMCONDITIONID
            FROM DUAL;
    END;
/

create or replace trigger TRG_ITEMCONDITION_AUDIT
    BEFORE INSERT or UPDATE
    on T_ITEMSTATUS
    FOR EACH ROW
    BEGIN
      :NEW.updatedby := USER;
      :NEW.lastDateUpdated := SYSDATE;
    END;
/

CREATE TRIGGER TRG_PCUSTODIAN_IDSEQ
    BEFORE INSERT
    ON T_PRIMARYCUSTODIANS
    FOR EACH ROW
    BEGIN
        SELECT S_PCUSTODIAN.NEXTVAL INTO :new.ID
            FROM DUAL;
    END;
/

create or replace trigger TRG_PCUSTODIAN_AUDIT
    BEFORE INSERT or UPDATE
    on T_PRIMARYCUSTODIANS
    FOR EACH ROW
    BEGIN
      :NEW.updatedby := USER;
      :NEW.lastDateUpdated := SYSDATE;
    END;
/

CREATE OR REPLACE TRIGGER TRG_ALTCUSTODIAN_IDSEQ
    BEFORE INSERT
    ON T_ACCOUNT_ALTCUSTODIANS_LINK
    FOR EACH ROW
    BEGIN
        SELECT S_ALTCUSTODIANs.NEXTVAL INTO :new.ID
            FROM DUAL;
    END;
/

create or replace trigger TRG_ALTCUSTODIAN_AUDIT
    BEFORE INSERT or UPDATE
    on T_ACCOUNT_ALTCUSTODIANS_LINK
    FOR EACH ROW
    BEGIN
      :NEW.updatedby := USER;
      :NEW.lastDateUpdated := SYSDATE;
    END;
/

CREATE OR REPLACE TRIGGER TRG_ACCTITEM_IDSEQ
    BEFORE INSERT
    ON T_ACCT_ITEM_LINK
    FOR EACH ROW
    BEGIN
        SELECT S_ACCTITEM.NEXTVAL INTO :new.ID
            FROM DUAL;
    END;
/

create or replace trigger TRG_ACCTITEM_AUDIT
    BEFORE INSERT or UPDATE
    on T_ACCT_ITEM_LINK
    FOR EACH ROW
    BEGIN
      :NEW.updatedby := USER;
      :NEW.lastDateUpdated := SYSDATE;
    END;
/

CREATE OR REPLACE TRIGGER TRG_MANUFACTURER_IDSEQ
    BEFORE INSERT
    ON T_MANUFACTURER
    FOR EACH ROW
    BEGIN
        SELECT S_MANUFACTURER.NEXTVAL INTO :new.MANUFACTURERID
            FROM DUAL;
    END;
/

create or replace trigger TRG_MANUFACTURER_AUDIT
    BEFORE INSERT or UPDATE
    on T_MANUFACTURER
    FOR EACH ROW
    BEGIN
      :NEW.updatedby := USER;
      :NEW.lastDateUpdated := SYSDATE;
    END;
/

CREATE OR REPLACE TRIGGER TRG_DRMOPACKAGE_IDSEQ
    BEFORE INSERT
    ON T_DRMOPACKAGE
    FOR EACH ROW
    BEGIN
        SELECT S_DRMOPACKAGE.NEXTVAL INTO :new.DRMOPACKAGEID
            FROM DUAL;
    END;
/

create or replace trigger TRG_DRMOPACKAGE_AUDIT
    BEFORE INSERT or UPDATE
    on T_DRMOPACKAGE
    FOR EACH ROW
    BEGIN
      :NEW.updatedby := USER;
      :NEW.lastDateUpdated := SYSDATE;
    END;
/

CREATE OR REPLACE TRIGGER TRG_DRMOITEM_IDSEQ
    BEFORE INSERT
    ON T_DRMO_ITEM_LINK
    FOR EACH ROW
    BEGIN
        SELECT S_DRMOITEM.NEXTVAL INTO :new.ID
            FROM DUAL;
    END;
/

create or replace trigger TRG_DRMOITEM_AUDIT
    BEFORE INSERT or UPDATE
    on T_DRMO_ITEM_LINK
    FOR EACH ROW
    BEGIN
      :NEW.updatedby := USER;
      :NEW.lastDateUpdated := SYSDATE;
    END;
/

CREATE OR REPLACE TRIGGER TRG_MODEL_IDSEQ
    BEFORE INSERT
    ON T_MODEL
    FOR EACH ROW
    BEGIN
        SELECT S_MODEL.NEXTVAL INTO :new.MODELID
            FROM DUAL;
    END;
/

create or replace trigger TRG_MODEL_AUDIT
    BEFORE INSERT or UPDATE
    on T_MODEL
    FOR EACH ROW
    BEGIN
      :NEW.updatedby := USER;
      :NEW.lastDateUpdated := SYSDATE;
    END;
/